package HomeWork;

/**
 * @description:
 * @Author yyp
 * @time
 */
public class HomeWork04 {
    public static void main(String[] args) {
        CellPhone phone = new CellPhone();
        phone.testWork(new ICaculate() {
            @Override
            public int work(int i1, int i2) {
                return i1+i2;
            }
        },10,10);
        CellPhone phone2 = new CellPhone();
        phone2.testWork(new ICaculate() {
            @Override
            public int work(int i1, int i2) {
                return i1-i2;
            }
        },10,10);
    }
}

interface ICaculate{
    int work(int i1,int i2);
}

class CellPhone{
    public void testWork(ICaculate iCaculate,int n1,int n2){
        int ret = iCaculate.work(n1,n2);
        System.out.println(ret);
    }
}
